Hi
I myself wrote the code below some months ago. But now I have forgotten much of C++ I learned so please help me to rejuvenate the memory. Why did I use single quotes around "|"? Shouldn't I have used double quotes? I know there is a reason for using single quotes but I can't recall it. Please help me. Thank you.
Code:
/* arranging the three numbers in ascending order assuming the numbers
are distinct */
// there would be six permutations in total
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
float A, B, C;
cout << "enter the numbers A, B, C" << endl ;
cout << "enter A = " ;
cin >> A;
cout << "enter B = " ;
cin >> B;
cout << "enter C = " ;
cin >> C;
if ( (A < B) && (B < C) )
cout << "the ascending order is " << A << '|' << B << '|' << C << endl;
else if ( (A < C) && (C < B) )
cout << "the ascending order is " << A << '|' << C << '|' << B << endl;
else if ( (B < A) && (A < C) )
cout << "the ascending order is " << B << '|' << A << '|' << C << endl;
else if ( (B < C) && (C < A) )
cout << "the ascending order is " << B << '|' << C << '|' << A << endl;
else if ( (C < A) && (A < B) )
cout << "the ascending order is " << C << '|' << A << '|' << B << endl;
else if ( (C < B) && (B < A) )
cout << "the ascending order is " << C << '|' << B << '|' << A
<< endl;
else
cout << "Input error" << endl;
system("pause");
return 0;
}